.class public Lcom/zuiapps/suite/utils/network/APNManager;
.super Ljava/lang/Object;
.source "APNManager.java"


# static fields
.field private static final APN_TABLE_URI:Landroid/net/Uri;

.field private static final PREFERRED_APN_URI:Landroid/net/Uri;

.field private static apnManager:Lcom/zuiapps/suite/utils/network/APNManager;


# instance fields
.field private mContext:Landroid/content/Context;

.field private resolver:Landroid/content/ContentResolver;

.field private tm:Landroid/telephony/TelephonyManager;


# direct methods
.method static constructor <clinit>()V
    .registers 1

    .prologue
    .line 21
    const-string v0, "content://telephony/carriers/preferapn"

    .line 22
    invoke-static {v0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v0

    sput-object v0, Lcom/zuiapps/suite/utils/network/APNManager;->PREFERRED_APN_URI:Landroid/net/Uri;

    .line 23
    const-string v0, "content://telephony/carriers"

    .line 24
    invoke-static {v0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v0

    sput-object v0, Lcom/zuiapps/suite/utils/network/APNManager;->APN_TABLE_URI:Landroid/net/Uri;

    .line 29
    const/4 v0, 0x0

    sput-object v0, Lcom/zuiapps/suite/utils/network/APNManager;->apnManager:Lcom/zuiapps/suite/utils/network/APNManager;

    return-void
.end method

.method private constructor <init>(Landroid/content/Context;)V
    .registers 3
    .param p1, "context"    # Landroid/content/Context;

    .prologue
    .line 38
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 39
    invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    iput-object v0, p0, Lcom/zuiapps/suite/utils/network/APNManager;->resolver:Landroid/content/ContentResolver;

    .line 40
    iput-object p1, p0, Lcom/zuiapps/suite/utils/network/APNManager;->mContext:Landroid/content/Context;

    .line 41
    const-string v0, "phone"

    .line 42
    invoke-virtual {p1, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/telephony/TelephonyManager;

    iput-object v0, p0, Lcom/zuiapps/suite/utils/network/APNManager;->tm:Landroid/telephony/TelephonyManager;

    .line 43
    return-void
.end method

.method private addNewApn(Lcom/zuiapps/suite/utils/network/APN;)I
    .registers 13
    .param p1, "apnNode"    # Lcom/zuiapps/suite/utils/network/APN;

    .prologue
    .line 212
    const/4 v6, -0x1

    .line 213
    .local v6, "apnId":I
    new-instance v10, Landroid/content/ContentValues;

    invoke-direct {v10}, Landroid/content/ContentValues;-><init>()V

    .line 214
    .local v10, "values":Landroid/content/ContentValues;
    const-string v0, "name"

    invoke-virtual {p1}, Lcom/zuiapps/suite/utils/network/APN;->getName()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v10, v0, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 215
    const-string v0, "apn"

    invoke-virtual {p1}, Lcom/zuiapps/suite/utils/network/APN;->getApn()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v10, v0, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 216
    const-string v0, "proxy"

    invoke-virtual {p1}, Lcom/zuiapps/suite/utils/network/APN;->getProxy()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v10, v0, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 217
    const-string v0, "port"

    invoke-virtual {p1}, Lcom/zuiapps/suite/utils/network/APN;->getPort()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v10, v0, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 218
    const-string v0, "user"

    invoke-virtual {p1}, Lcom/zuiapps/suite/utils/network/APN;->getUser()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v10, v0, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 219
    const-string v0, "password"

    invoke-virtual {p1}, Lcom/zuiapps/suite/utils/network/APN;->getPassword()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v10, v0, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 220
    const-string v0, "mcc"

    invoke-virtual {p1}, Lcom/zuiapps/suite/utils/network/APN;->getMcc()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v10, v0, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 221
    const-string v0, "mnc"

    invoke-virtual {p1}, Lcom/zuiapps/suite/utils/network/APN;->getMnc()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v10, v0, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 222
    const-string v0, "numeric"

    invoke-virtual {p1}, Lcom/zuiapps/suite/utils/network/APN;->getNumeric()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v10, v0, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 224
    const/4 v7, 0x0

    .line 227
    .local v7, "c":Landroid/database/Cursor;
    :try_start_58
    iget-object v0, p0, Lcom/zuiapps/suite/utils/network/APNManager;->resolver:Landroid/content/ContentResolver;

    sget-object v2, Lcom/zuiapps/suite/utils/network/APNManager;->APN_TABLE_URI:Landroid/net/Uri;

    invoke-virtual {v0, v2, v10}, Landroid/content/ContentResolver;->insert(Landroid/net/Uri;Landroid/content/ContentValues;)Landroid/net/Uri;

    move-result-object v1

    .line 229
    .local v1, "newRow":Landroid/net/Uri;
    if-eqz v1, :cond_97

    .line 230
    iget-object v0, p0, Lcom/zuiapps/suite/utils/network/APNManager;->resolver:Landroid/content/ContentResolver;

    const/4 v2, 0x0

    const/4 v3, 0x0

    const/4 v4, 0x0

    const/4 v5, 0x0

    invoke-virtual/range {v0 .. v5}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v7

    .line 232
    const-string v0, "_id"

    invoke-interface {v7, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v9

    .line 233
    .local v9, "idindex":I
    invoke-interface {v7}, Landroid/database/Cursor;->moveToFirst()Z

    .line 234
    invoke-interface {v7, v9}, Landroid/database/Cursor;->getShort(I)S

    move-result v6

    .line 235
    const-string v0, "Robert"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "New ID: "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, v6}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, ": Inserting new APN succeeded!"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v0, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I
    :try_end_97
    .catch Landroid/database/SQLException; {:try_start_58 .. :try_end_97} :catch_9d

    .line 243
    .end local v1    # "newRow":Landroid/net/Uri;
    .end local v9    # "idindex":I
    :cond_97
    :goto_97
    if-eqz v7, :cond_9c

    .line 244
    invoke-interface {v7}, Landroid/database/Cursor;->close()V

    .line 245
    :cond_9c
    return v6

    .line 239
    :catch_9d
    move-exception v8

    .line 240
    .local v8, "e":Landroid/database/SQLException;
    invoke-virtual {v8}, Landroid/database/SQLException;->printStackTrace()V

    goto :goto_97
.end method

.method public static getInstance(Landroid/content/Context;)Lcom/zuiapps/suite/utils/network/APNManager;
    .registers 2
    .param p0, "context"    # Landroid/content/Context;

    .prologue
    .line 32
    sget-object v0, Lcom/zuiapps/suite/utils/network/APNManager;->apnManager:Lcom/zuiapps/suite/utils/network/APNManager;

    if-eqz v0, :cond_b

    .line 33
    new-instance v0, Lcom/zuiapps/suite/utils/network/APNManager;

    invoke-direct {v0, p0}, Lcom/zuiapps/suite/utils/network/APNManager;-><init>(Landroid/content/Context;)V

    sput-object v0, Lcom/zuiapps/suite/utils/network/APNManager;->apnManager:Lcom/zuiapps/suite/utils/network/APNManager;

    .line 35
    :cond_b
    sget-object v0, Lcom/zuiapps/suite/utils/network/APNManager;->apnManager:Lcom/zuiapps/suite/utils/network/APNManager;

    return-object v0
.end method

.method private getMCC()Ljava/lang/String;
    .registers 5

    .prologue
    .line 249
    iget-object v2, p0, Lcom/zuiapps/suite/utils/network/APNManager;->tm:Landroid/telephony/TelephonyManager;

    invoke-virtual {v2}, Landroid/telephony/TelephonyManager;->getSimOperator()Ljava/lang/String;

    move-result-object v1

    .line 250
    .local v1, "numeric":Ljava/lang/String;
    const/4 v2, 0x0

    const/4 v3, 0x3

    invoke-virtual {v1, v2, v3}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v0

    .line 251
    .local v0, "mcc":Ljava/lang/String;
    const-string v2, "MCC  is"

    invoke-static {v2, v0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 252
    return-object v0
.end method

.method private getMNC()Ljava/lang/String;
    .registers 5

    .prologue
    .line 257
    iget-object v2, p0, Lcom/zuiapps/suite/utils/network/APNManager;->tm:Landroid/telephony/TelephonyManager;

    invoke-virtual {v2}, Landroid/telephony/TelephonyManager;->getSimOperator()Ljava/lang/String;

    move-result-object v1

    .line 258
    .local v1, "numeric":Ljava/lang/String;
    const/4 v2, 0x3

    invoke-virtual {v1}, Ljava/lang/String;->length()I

    move-result v3

    invoke-virtual {v1, v2, v3}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v0

    .line 259
    .local v0, "mnc":Ljava/lang/String;
    const-string v2, "MNC  is"

    invoke-static {v2, v0}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 260
    return-object v0
.end method

.method private getSimOperator()Ljava/lang/String;
    .registers 3

    .prologue
    .line 264
    iget-object v1, p0, Lcom/zuiapps/suite/utils/network/APNManager;->tm:Landroid/telephony/TelephonyManager;

    invoke-virtual {v1}, Landroid/telephony/TelephonyManager;->getSimOperator()Ljava/lang/String;

    move-result-object v0

    .line 265
    .local v0, "SimOperator":Ljava/lang/String;
    return-object v0
.end method


# virtual methods
.method public InsetAPN()I
    .registers 3

    .prologue
    .line 191
    new-instance v0, Lcom/zuiapps/suite/utils/network/APN;

    invoke-direct {v0}, Lcom/zuiapps/suite/utils/network/APN;-><init>()V

    .line 192
    .local v0, "checkApn":Lcom/zuiapps/suite/utils/network/APN;
    const-string v1, "\u7231\u5bb6\u7269\u8054\u4e13\u7528\u63a5\u53e3"

    invoke-virtual {v0, v1}, Lcom/zuiapps/suite/utils/network/APN;->setName(Ljava/lang/String;)V

    .line 193
    const-string v1, "ctnet"

    invoke-virtual {v0, v1}, Lcom/zuiapps/suite/utils/network/APN;->setApn(Ljava/lang/String;)V

    .line 196
    const-string v1, "qdaj@qdaj.vpdn.sd"

    invoke-virtual {v0, v1}, Lcom/zuiapps/suite/utils/network/APN;->setUser(Ljava/lang/String;)V

    .line 197
    const-string v1, "123456"

    invoke-virtual {v0, v1}, Lcom/zuiapps/suite/utils/network/APN;->setPassword(Ljava/lang/String;)V

    .line 198
    invoke-direct {p0}, Lcom/zuiapps/suite/utils/network/APNManager;->getMCC()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/zuiapps/suite/utils/network/APN;->setMcc(Ljava/lang/String;)V

    .line 199
    invoke-direct {p0}, Lcom/zuiapps/suite/utils/network/APNManager;->getMNC()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/zuiapps/suite/utils/network/APN;->setMnc(Ljava/lang/String;)V

    .line 200
    invoke-direct {p0}, Lcom/zuiapps/suite/utils/network/APNManager;->getSimOperator()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/zuiapps/suite/utils/network/APN;->setNumeric(Ljava/lang/String;)V

    .line 201
    invoke-direct {p0, v0}, Lcom/zuiapps/suite/utils/network/APNManager;->addNewApn(Lcom/zuiapps/suite/utils/network/APN;)I

    move-result v1

    return v1
.end method

.method public deleteApn()V
    .registers 4

    .prologue
    const/4 v2, 0x0

    .line 117
    iget-object v0, p0, Lcom/zuiapps/suite/utils/network/APNManager;->resolver:Landroid/content/ContentResolver;

    sget-object v1, Lcom/zuiapps/suite/utils/network/APNManager;->APN_TABLE_URI:Landroid/net/Uri;

    invoke-virtual {v0, v1, v2, v2}, Landroid/content/ContentResolver;->delete(Landroid/net/Uri;Ljava/lang/String;[Ljava/lang/String;)I

    .line 118
    return-void
.end method

.method public getAPNList()Ljava/util/List;
    .registers 11
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List",
            "<",
            "Lcom/zuiapps/suite/utils/network/APN;",
            ">;"
        }
    .end annotation

    .prologue
    const/4 v3, 0x0

    .line 304
    const-string v9, "Main.getAPNList()"

    .line 306
    .local v9, "tag":Ljava/lang/String;
    const/4 v0, 0x1

    new-array v2, v0, [Ljava/lang/String;

    const/4 v0, 0x0

    const-string v1, "_id,apn,type,current"

    aput-object v1, v2, v0

    .line 307
    .local v2, "projection":[Ljava/lang/String;
    iget-object v0, p0, Lcom/zuiapps/suite/utils/network/APNManager;->mContext:Landroid/content/Context;

    invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    sget-object v1, Lcom/zuiapps/suite/utils/network/APNManager;->APN_TABLE_URI:Landroid/net/Uri;

    move-object v4, v3

    move-object v5, v3

    invoke-virtual/range {v0 .. v5}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v7

    .line 309
    .local v7, "cr":Landroid/database/Cursor;
    new-instance v8, Ljava/util/ArrayList;

    invoke-direct {v8}, Ljava/util/ArrayList;-><init>()V

    .line 310
    .local v8, "list":Ljava/util/List;, "Ljava/util/List<Lcom/zuiapps/suite/utils/network/APN;>;"
    :goto_1e
    if-eqz v7, :cond_aa

    invoke-interface {v7}, Landroid/database/Cursor;->moveToNext()Z

    move-result v0

    if-eqz v0, :cond_aa

    .line 311
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "_id"

    .line 312
    invoke-interface {v7, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v1

    invoke-interface {v7, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "  "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "apn"

    .line 313
    invoke-interface {v7, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v1

    invoke-interface {v7, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "  "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "type"

    .line 314
    invoke-interface {v7, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v1

    invoke-interface {v7, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "  "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "current"

    .line 315
    invoke-interface {v7, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v1

    invoke-interface {v7, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    .line 311
    invoke-static {v9, v0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 316
    new-instance v6, Lcom/zuiapps/suite/utils/network/APN;

    invoke-direct {v6}, Lcom/zuiapps/suite/utils/network/APN;-><init>()V

    .line 317
    .local v6, "a":Lcom/zuiapps/suite/utils/network/APN;
    const-string v0, "_id"

    invoke-interface {v7, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {v7, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, v6, Lcom/zuiapps/suite/utils/network/APN;->apnId:Ljava/lang/String;

    .line 318
    const-string v0, "apn"

    invoke-interface {v7, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {v7, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, v6, Lcom/zuiapps/suite/utils/network/APN;->apn:Ljava/lang/String;

    .line 319
    const-string v0, "type"

    invoke-interface {v7, v0}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v0

    invoke-interface {v7, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    iput-object v0, v6, Lcom/zuiapps/suite/utils/network/APN;->type:Ljava/lang/String;

    .line 320
    invoke-interface {v8, v6}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto/16 :goto_1e

    .line 322
    .end local v6    # "a":Lcom/zuiapps/suite/utils/network/APN;
    :cond_aa
    if-eqz v7, :cond_af

    .line 323
    invoke-interface {v7}, Landroid/database/Cursor;->close()V

    .line 324
    :cond_af
    return-object v8
.end method

.method public getDefaultAPN()Lcom/zuiapps/suite/utils/network/APN;
    .registers 19

    .prologue
    .line 121
    const-string v9, ""

    .line 122
    .local v9, "id":Ljava/lang/String;
    const-string v7, ""

    .line 123
    .local v7, "apn":Ljava/lang/String;
    const-string v16, ""

    .line 124
    .local v16, "proxy":Ljava/lang/String;
    const-string v13, ""

    .line 125
    .local v13, "name":Ljava/lang/String;
    const-string v15, ""

    .line 126
    .local v15, "port":Ljava/lang/String;
    const-string v17, ""

    .line 127
    .local v17, "type":Ljava/lang/String;
    const-string v11, ""

    .line 128
    .local v11, "mcc":Ljava/lang/String;
    const-string v12, ""

    .line 129
    .local v12, "mnc":Ljava/lang/String;
    const-string v14, ""

    .line 130
    .local v14, "numeric":Ljava/lang/String;
    new-instance v8, Lcom/zuiapps/suite/utils/network/APN;

    invoke-direct {v8}, Lcom/zuiapps/suite/utils/network/APN;-><init>()V

    .line 131
    .local v8, "apnNode":Lcom/zuiapps/suite/utils/network/APN;
    move-object/from16 v0, p0

    iget-object v1, v0, Lcom/zuiapps/suite/utils/network/APNManager;->resolver:Landroid/content/ContentResolver;

    sget-object v2, Lcom/zuiapps/suite/utils/network/APNManager;->PREFERRED_APN_URI:Landroid/net/Uri;

    const/4 v3, 0x0

    const/4 v4, 0x0

    const/4 v5, 0x0

    const/4 v6, 0x0

    invoke-virtual/range {v1 .. v6}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v10

    .line 133
    .local v10, "mCursor":Landroid/database/Cursor;
    if-nez v10, :cond_29

    .line 135
    const/4 v8, 0x0

    .line 158
    .end local v8    # "apnNode":Lcom/zuiapps/suite/utils/network/APN;
    :goto_28
    return-object v8

    .line 138
    .restart local v8    # "apnNode":Lcom/zuiapps/suite/utils/network/APN;
    :cond_29
    :goto_29
    if-eqz v10, :cond_cb

    invoke-interface {v10}, Landroid/database/Cursor;->moveToNext()Z

    move-result v1

    if-eqz v1, :cond_cb

    .line 139
    const-string v1, "_id"

    invoke-interface {v10, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v1

    invoke-interface {v10, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v9

    .line 140
    const-string v1, "name"

    invoke-interface {v10, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v1

    invoke-interface {v10, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v13

    .line 141
    const-string v1, "apn"

    invoke-interface {v10, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v1

    invoke-interface {v10, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v7

    .line 142
    const-string v1, "proxy"

    invoke-interface {v10, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v1

    invoke-interface {v10, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v16

    .line 143
    const-string v1, "port"

    invoke-interface {v10, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v1

    invoke-interface {v10, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v15

    .line 144
    const-string v1, "mcc"

    invoke-interface {v10, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v1

    invoke-interface {v10, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v11

    .line 145
    const-string v1, "mnc"

    invoke-interface {v10, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v1

    invoke-interface {v10, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v12

    .line 146
    const-string v1, "numeric"

    invoke-interface {v10, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v1

    invoke-interface {v10, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v14

    .line 147
    const-string v1, "getDefaultAPN"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "default Apn info:"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, "_"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, v13}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, "_"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, "_"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    move-object/from16 v0, v16

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, "_"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    move-object/from16 v0, v16

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    goto/16 :goto_29

    .line 151
    :cond_cb
    invoke-virtual {v8, v13}, Lcom/zuiapps/suite/utils/network/APN;->setName(Ljava/lang/String;)V

    .line 152
    invoke-virtual {v8, v7}, Lcom/zuiapps/suite/utils/network/APN;->setApn(Ljava/lang/String;)V

    .line 153
    move-object/from16 v0, v16

    invoke-virtual {v8, v0}, Lcom/zuiapps/suite/utils/network/APN;->setProxy(Ljava/lang/String;)V

    .line 154
    invoke-virtual {v8, v15}, Lcom/zuiapps/suite/utils/network/APN;->setPort(Ljava/lang/String;)V

    .line 155
    invoke-virtual {v8, v11}, Lcom/zuiapps/suite/utils/network/APN;->setMcc(Ljava/lang/String;)V

    .line 156
    invoke-virtual {v8, v12}, Lcom/zuiapps/suite/utils/network/APN;->setMnc(Ljava/lang/String;)V

    .line 157
    invoke-virtual {v8, v14}, Lcom/zuiapps/suite/utils/network/APN;->setNumeric(Ljava/lang/String;)V

    goto/16 :goto_28
.end method

.method public getDefaultNetworkType()I
    .registers 9

    .prologue
    const/4 v5, 0x1

    .line 162
    const/4 v3, -0x1

    .line 163
    .local v3, "networkType":I
    iget-object v6, p0, Lcom/zuiapps/suite/utils/network/APNManager;->mContext:Landroid/content/Context;

    const-string v7, "connectivity"

    .line 164
    invoke-virtual {v6, v7}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/net/ConnectivityManager;

    .line 165
    .local v0, "connectivity":Landroid/net/ConnectivityManager;
    if-nez v0, :cond_10

    :cond_e
    :goto_e
    move v5, v3

    .line 186
    :cond_f
    return v5

    .line 170
    :cond_10
    invoke-virtual {v0, v5}, Landroid/net/ConnectivityManager;->getNetworkInfo(I)Landroid/net/NetworkInfo;

    move-result-object v4

    .line 171
    .local v4, "wifiNetworkInfo":Landroid/net/NetworkInfo;
    if-eqz v4, :cond_1e

    .line 172
    invoke-virtual {v4}, Landroid/net/NetworkInfo;->getState()Landroid/net/NetworkInfo$State;

    move-result-object v6

    sget-object v7, Landroid/net/NetworkInfo$State;->CONNECTED:Landroid/net/NetworkInfo$State;

    if-eq v6, v7, :cond_f

    .line 176
    :cond_1e
    invoke-virtual {v0}, Landroid/net/ConnectivityManager;->getAllNetworkInfo()[Landroid/net/NetworkInfo;

    move-result-object v2

    .line 177
    .local v2, "info":[Landroid/net/NetworkInfo;
    const/4 v1, 0x0

    .local v1, "i":I
    :goto_23
    array-length v5, v2

    if-ge v1, v5, :cond_e

    .line 178
    aget-object v5, v2, v1

    invoke-virtual {v5}, Landroid/net/NetworkInfo;->getState()Landroid/net/NetworkInfo$State;

    move-result-object v5

    sget-object v6, Landroid/net/NetworkInfo$State;->CONNECTED:Landroid/net/NetworkInfo$State;

    if-ne v5, v6, :cond_37

    .line 180
    aget-object v5, v2, v1

    invoke-virtual {v5}, Landroid/net/NetworkInfo;->getType()I

    move-result v3

    .line 181
    goto :goto_e

    .line 177
    :cond_37
    add-int/lit8 v1, v1, 0x1

    goto :goto_23
.end method

.method public isApnExisted(Lcom/zuiapps/suite/utils/network/APN;)I
    .registers 21
    .param p1, "apnNode"    # Lcom/zuiapps/suite/utils/network/APN;

    .prologue
    .line 52
    const/4 v8, -0x1

    .line 53
    .local v8, "apnId":I
    move-object/from16 v0, p0

    iget-object v1, v0, Lcom/zuiapps/suite/utils/network/APNManager;->resolver:Landroid/content/ContentResolver;

    sget-object v2, Lcom/zuiapps/suite/utils/network/APNManager;->APN_TABLE_URI:Landroid/net/Uri;

    const/4 v3, 0x0

    const/4 v4, 0x0

    const/4 v5, 0x0

    const/4 v6, 0x0

    invoke-virtual/range {v1 .. v6}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v11

    .line 54
    .local v11, "mCursor":Landroid/database/Cursor;
    :goto_f
    if-eqz v11, :cond_10c

    invoke-interface {v11}, Landroid/database/Cursor;->moveToNext()Z

    move-result v1

    if-eqz v1, :cond_10c

    .line 55
    const-string v1, "_id"

    invoke-interface {v11, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v1

    invoke-interface {v11, v1}, Landroid/database/Cursor;->getShort(I)S

    move-result v8

    .line 56
    const-string v1, "name"

    invoke-interface {v11, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v1

    invoke-interface {v11, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v14

    .line 57
    .local v14, "name":Ljava/lang/String;
    const-string v1, "apn"

    invoke-interface {v11, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v1

    invoke-interface {v11, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v7

    .line 58
    .local v7, "apn":Ljava/lang/String;
    const-string v1, "type"

    invoke-interface {v11, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v1

    invoke-interface {v11, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v18

    .line 59
    .local v18, "type":Ljava/lang/String;
    const-string v1, "proxy"

    invoke-interface {v11, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v1

    invoke-interface {v11, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v17

    .line 60
    .local v17, "proxy":Ljava/lang/String;
    const-string v1, "port"

    invoke-interface {v11, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v1

    invoke-interface {v11, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v16

    .line 61
    .local v16, "port":Ljava/lang/String;
    const-string v1, "current"

    .line 62
    invoke-interface {v11, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v1

    .line 61
    invoke-interface {v11, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v10

    .line 63
    .local v10, "current":Ljava/lang/String;
    const-string v1, "mcc"

    invoke-interface {v11, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v1

    invoke-interface {v11, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v12

    .line 64
    .local v12, "mcc":Ljava/lang/String;
    const-string v1, "mnc"

    invoke-interface {v11, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v1

    invoke-interface {v11, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v13

    .line 65
    .local v13, "mnc":Ljava/lang/String;
    const-string v1, "numeric"

    .line 66
    invoke-interface {v11, v1}, Landroid/database/Cursor;->getColumnIndex(Ljava/lang/String;)I

    move-result v1

    .line 65
    invoke-interface {v11, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v15

    .line 67
    .local v15, "numeric":Ljava/lang/String;
    const-string v1, "isApnExisted"

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "info:"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, v8}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, "_"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, v14}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, "_"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, "_"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    move-object/from16 v0, v18

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, "_"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, "_"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    move-object/from16 v0, v17

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 69
    invoke-virtual/range {p1 .. p1}, Lcom/zuiapps/suite/utils/network/APN;->getApn()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v1, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_109

    .line 71
    invoke-virtual/range {p1 .. p1}, Lcom/zuiapps/suite/utils/network/APN;->getMcc()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v1, v12}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_109

    .line 72
    invoke-virtual/range {p1 .. p1}, Lcom/zuiapps/suite/utils/network/APN;->getMnc()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v1, v13}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_109

    invoke-virtual/range {p1 .. p1}, Lcom/zuiapps/suite/utils/network/APN;->getNumeric()Ljava/lang/String;

    move-result-object v1

    .line 73
    invoke-virtual {v1, v15}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_109

    if-eqz v18, :cond_107

    const-string v1, "default"

    .line 74
    move-object/from16 v0, v18

    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-nez v1, :cond_107

    const-string v1, ""

    .line 75
    move-object/from16 v0, v18

    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_109

    :cond_107
    move v9, v8

    .line 85
    .end local v7    # "apn":Ljava/lang/String;
    .end local v8    # "apnId":I
    .end local v10    # "current":Ljava/lang/String;
    .end local v12    # "mcc":Ljava/lang/String;
    .end local v13    # "mnc":Ljava/lang/String;
    .end local v14    # "name":Ljava/lang/String;
    .end local v15    # "numeric":Ljava/lang/String;
    .end local v16    # "port":Ljava/lang/String;
    .end local v17    # "proxy":Ljava/lang/String;
    .end local v18    # "type":Ljava/lang/String;
    .local v9, "apnId":I
    :goto_108
    return v9

    .line 81
    .end local v9    # "apnId":I
    .restart local v7    # "apn":Ljava/lang/String;
    .restart local v8    # "apnId":I
    .restart local v10    # "current":Ljava/lang/String;
    .restart local v12    # "mcc":Ljava/lang/String;
    .restart local v13    # "mnc":Ljava/lang/String;
    .restart local v14    # "name":Ljava/lang/String;
    .restart local v15    # "numeric":Ljava/lang/String;
    .restart local v16    # "port":Ljava/lang/String;
    .restart local v17    # "proxy":Ljava/lang/String;
    .restart local v18    # "type":Ljava/lang/String;
    :cond_109
    const/4 v8, -0x1

    .line 84
    goto/16 :goto_f

    .end local v7    # "apn":Ljava/lang/String;
    .end local v10    # "current":Ljava/lang/String;
    .end local v12    # "mcc":Ljava/lang/String;
    .end local v13    # "mnc":Ljava/lang/String;
    .end local v14    # "name":Ljava/lang/String;
    .end local v15    # "numeric":Ljava/lang/String;
    .end local v16    # "port":Ljava/lang/String;
    .end local v17    # "proxy":Ljava/lang/String;
    .end local v18    # "type":Ljava/lang/String;
    :cond_10c
    move v9, v8

    .line 85
    .end local v8    # "apnId":I
    .restart local v9    # "apnId":I
    goto :goto_108
.end method

.method public matchAPN(Ljava/lang/String;)Ljava/lang/String;
    .registers 3
    .param p1, "currentName"    # Ljava/lang/String;

    .prologue
    .line 269
    const-string v0, ""

    invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_a

    if-nez p1, :cond_d

    .line 270
    :cond_a
    const-string v0, ""

    .line 294
    :goto_c
    return-object v0

    .line 272
    :cond_d
    invoke-virtual {p1}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object p1

    .line 273
    const-string v0, "cmnet"

    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_21

    const-string v0, "CMNET"

    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_24

    .line 274
    :cond_21
    const-string v0, "cmnet"

    goto :goto_c

    .line 275
    :cond_24
    const-string v0, "cmwap"

    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_34

    const-string v0, "CMWAP"

    .line 276
    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_37

    .line 277
    :cond_34
    const-string v0, "cmwap"

    goto :goto_c

    .line 278
    :cond_37
    const-string v0, "3gwap"

    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_47

    const-string v0, "3GWAP"

    .line 279
    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_4a

    .line 280
    :cond_47
    const-string v0, "3gwap"

    goto :goto_c

    .line 281
    :cond_4a
    const-string v0, "3gnet"

    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_5a

    const-string v0, "3GNET"

    .line 282
    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_5d

    .line 283
    :cond_5a
    const-string v0, "3gnet"

    goto :goto_c

    .line 284
    :cond_5d
    const-string v0, "uninet"

    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_6d

    const-string v0, "UNINET"

    .line 285
    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_70

    .line 286
    :cond_6d
    const-string v0, "uninet"

    goto :goto_c

    .line 287
    :cond_70
    const-string v0, "uniwap"

    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_80

    const-string v0, "UNIWAP"

    .line 288
    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_83

    .line 289
    :cond_80
    const-string v0, "uniwap"

    goto :goto_c

    .line 290
    :cond_83
    const-string v0, "default"

    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_93

    const-string v0, "DEFAULT"

    .line 291
    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_97

    .line 292
    :cond_93
    const-string v0, "default"

    goto/16 :goto_c

    .line 294
    :cond_97
    const-string v0, ""

    goto/16 :goto_c
.end method

.method public setDefaultApn(I)Z
    .registers 12
    .param p1, "apnId"    # I

    .prologue
    .line 95
    const/4 v8, 0x0

    .line 96
    .local v8, "res":Z
    new-instance v9, Landroid/content/ContentValues;

    invoke-direct {v9}, Landroid/content/ContentValues;-><init>()V

    .line 97
    .local v9, "values":Landroid/content/ContentValues;
    const-string v0, "apn_id"

    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v1

    invoke-virtual {v9, v0, v1}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 99
    :try_start_f
    iget-object v0, p0, Lcom/zuiapps/suite/utils/network/APNManager;->resolver:Landroid/content/ContentResolver;

    sget-object v1, Lcom/zuiapps/suite/utils/network/APNManager;->PREFERRED_APN_URI:Landroid/net/Uri;

    const/4 v2, 0x0

    const/4 v3, 0x0

    invoke-virtual {v0, v1, v9, v2, v3}, Landroid/content/ContentResolver;->update(Landroid/net/Uri;Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/String;)I

    .line 100
    iget-object v0, p0, Lcom/zuiapps/suite/utils/network/APNManager;->resolver:Landroid/content/ContentResolver;

    sget-object v1, Lcom/zuiapps/suite/utils/network/APNManager;->PREFERRED_APN_URI:Landroid/net/Uri;

    const/4 v2, 0x2

    new-array v2, v2, [Ljava/lang/String;

    const/4 v3, 0x0

    const-string v4, "name"

    aput-object v4, v2, v3

    const/4 v3, 0x1

    const-string v4, "apn"

    aput-object v4, v2, v3

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "_id="

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    const/4 v4, 0x0

    const/4 v5, 0x0

    invoke-virtual/range {v0 .. v5}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v6

    .line 102
    .local v6, "c":Landroid/database/Cursor;
    if-eqz v6, :cond_48

    .line 103
    const/4 v8, 0x1

    .line 104
    invoke-interface {v6}, Landroid/database/Cursor;->close()V
    :try_end_48
    .catch Landroid/database/SQLException; {:try_start_f .. :try_end_48} :catch_49

    .line 109
    .end local v6    # "c":Landroid/database/Cursor;
    :cond_48
    :goto_48
    return v8

    .line 106
    :catch_49
    move-exception v7

    .line 107
    .local v7, "e":Landroid/database/SQLException;
    invoke-virtual {v7}, Landroid/database/SQLException;->printStackTrace()V

    goto :goto_48
.end method
